package com.zmn.oms.third.dj58.service;


import com.zmn.oms.common.dto.ResultDTO;
import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.entity.work.OrderWorkLogChange;
import com.zmn.oms.third.dj58.dto.DaoJia58GetPriceListDTO;
import com.zmn.oms.third.dj58.dto.DaoJia58PriceItemDTO;
import com.zmn.oms.third.dj58.dto.DaoJia58SupplyPayDTO;
import com.zmn.oms.third.dj58.dto.DaoJia58SyncOrderStateDTO;
import com.zmn.oms.third.dj58.dto.api.DaoJia58Response;

import java.util.List;

/**
 * 类描述：与58到家直约平台的对接接口
 *
 * @author XieWenBing
 * @date 2019/11/01 12:53
 */
public interface DaoJia58Service {
    /**
     * 处理58到家发送的订单消息（创建线索，补充支付，取消订单，订单完成，订单金额变更等）
     * @param msg
     * @return Dj58Result
     * @author xiewenbing
     */
    DaoJia58Response onMessage(String msg);

    /**
     * 获取58直约到家补充支付的url
     * @param orderId
     * @return String
     * @author xiewenbing
     */
    String getSupplyPayUrl(Long orderId) throws OmsBaseException;

    /**
     * 同步接收订单给58到家直约服务
     * @param orderWorkLogChange
     * @return
     * @author xiewenbing
     */
    void sendAcceptOrderTo58DaoJia(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单服务开始状态给58到家直约服务
     * @param orderWorkLogChange
     * @return
     * @author xiewenbing
     */
    void sendBeginServiceTo58DaoJia(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 发送获取价目列表给58到家直约服务
     * @param daoJia58GetPriceListDTO
     * @return
     * @author xiewenbing
     */
    List<DaoJia58PriceItemDTO> sendGetPriceListTo58DaoJia(DaoJia58GetPriceListDTO daoJia58GetPriceListDTO) throws OmsBaseException;

    /**
     * 发送获取补充支付58到家直约服务
     * @param daoJia58SupplyPayDTO
     * @return String
     * @author xiewenbing
     */
    String sendSupplyPayTo58DaoJia(DaoJia58SupplyPayDTO daoJia58SupplyPayDTO) throws OmsBaseException;

    /**
     * 同步取消订单给58到家直约服务
     * @param orderWorkLogChange
     * @return
     * @author xiewenbing
     */
    void sendCancelOrderTo58DaoJia(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步修改订单给58到家直约服务
     * @param orderWorkLogChange
     * @return
     * @author xiewenbing
     */
    void sendUpdateOrderTo58DaoJia(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单完成给58到家直约服务
     * @param orderWorkLogChange
     * @return
     * @author xiewenbing
     */
    void sendFinishOrderTo58DaoJia(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     *
     * @param pathRequest
     * @param paramJson
     * @return
     */
    DaoJia58Response sendRequestTo58DaoJia(String pathRequest, String paramJson);

    /**
     *
     * @param orderId
     * @return
     */
    boolean secondPay4apartmentOrder(Long orderId) throws OmsBaseException;

    /**
     * 人工同步订单状态给58
     * @param syncOrderStateDTO
     * @return
     * @throws OmsBaseException
     */
    ResultDTO syncOrderState(DaoJia58SyncOrderStateDTO syncOrderStateDTO) throws OmsBaseException;
}
